package com.itheima.reggie.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.reggie.entity.ShoppingCart;

import java.util.List;

/**
 * @author Jiang
 * @date 2022/2/19
 */
public interface ShoppingCartService extends IService<ShoppingCart> {
    /**
     * 分页查询接口
     * @param page
     * @param pageSize
     * @return
     */
    Page<ShoppingCart> selectByPage(Integer page, Integer pageSize);

    /**
     * 查询所有的购物车商品
     * @return
     */
    List<ShoppingCart> selectByList();

    /**
     * 添加购物车
     * @param shoppingCart
     * @return
     */
    ShoppingCart addShoppingCart(ShoppingCart shoppingCart);

    /**
     * 减少数量
     * @param shoppingCart
     * @return
     */
    ShoppingCart delShoppingCart(ShoppingCart shoppingCart);

    /**
     * 清空购物车
     */
    void clearShoppingCart();
}
